Repository navigation
fix(deps): update dependency better-auth to v1.7.7 [security] - #8641
Open
renovate[bot] wants to merge 1 commit into
Open
renovate[bot] wants to merge 1 commit into
renovate[bot] wants to merge 1 commit into
Conversation
Contributor
|
Important Review skippedBot user detected. To trigger a single review, invoke the
|
renovate
Bot
force-pushed
the
renovate/npm-better-auth-vulnerability
branch
from
November 5, 2026 20:48
0a9fe15 to
e489d28
Compare
renovate
Bot
force-pushed
the
renovate/npm-better-auth-vulnerability
branch
from
November 11, 2026 15:04
e489d28 to
7dc6a23
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Note
This PR body was truncated due to platform limits.
This PR contains the following updates:
1.6.22→1.7.7better-auth: Device login approval does not show the requesting client or permissions
GHSA-q84f-53jg-9ppm
More information
Details
Am I affected?
You may be affected if you use
better-authfrom1.3.8-beta.3up to, but not including,1.7.0-rc.3, and you enable thedeviceAuthorization()plugin. This range includes all 1.6 releases.You are affected only if all of these are also true:
validateClientis not configured, or the attacker can use a valid public client.You are not affected if you do not enable the opt-in
deviceAuthorization()plugin.Summary
The device authorization plugin lets a user sign in on one device by approving a short code on another. In affected versions, the approval information given to the user leaves out which client asked for access and which permissions it wants. The official approval examples therefore show only a generic request and a code, so users cannot tell their own device from an attacker's request.
Impact
An attacker who convinces a signed-in user to approve the attacker's code receives a live Better Auth session token for that user. The attacker can then read or change any data the user's account can access. The attack needs the opt-in device flow, a request the attacker creates, and a user who actively approves it; it is not a sign-in bypass without user action.
Patches
The fix first shipped in
1.7.0-rc.3. Upgrade tobetter-auth@1.7.0or later. No 1.6 release contains the fix.After upgrading,
GET /devicereturns the requestingclient_idandscopeto the signed-in account that owns the request. If you built your own approval page, update it to show that client and those permissions, and keep approval disabled until they load.Workarounds
If you cannot upgrade yet, do the following:
deviceAuthorization(), or block untrusted access to/device/code.validateClientallowlist. Do not rely on the allowlist alone: it limits who can start the flow, but it does not give users the missing approval information.Technical details
A device starts the flow by calling
/device/code. The plugin stores the client identifier and any requested scope with the pending request. Before approval,GET /devicereturns only the user code and its status. This is true even for a signed-in session of the user account that owns the request. An approval page built from that response cannot show which client asked for access or which permissions it wants. After approval, the original device code can be redeemed at/device/tokenfor a Better Auth session token.RFC 8628 describes this remote phishing scenario. It recommends that the server tell users they are authorizing a device and ask them to confirm that the device is in their possession. It also recommends showing device information that helps users detect impersonation. Client allowlisting reduces who can start the flow, but it does not give users the missing approval information. A valid public client can therefore still be affected when its identifier and requested permissions are not shown.
Severity
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:NReferences
This data is provided by the GitHub Advisory Database (CC-BY 4.0).
better-auth: OAuth state can be used as a Magic Link to sign in as another user
CVE-2026-114607 / GHSA-965c-763c-88jm
More information
Details
Am I affected?
You may be affected if you use
better-authfrom1.4.0-beta.18through versions before1.7.7with the Magic Link plugin and social or Generic OAuth sign-in.You are affected if all of these are true:
storeToken: "plain", or withstoreToken: "hashed"and globalverification.storeIdentifier: "hashed"(including a hashed default).account.storeStateStrategy: "database", the default when a database or secondary storage is configured.Cookie-backed state blocks this path, subject to the OAuth Proxy condition below. With custom hashers, confirm the flows cannot resolve to the same stored identifier.
Summary
Better Auth accepts an OAuth sign-in state value as a Magic Link token. An attacker can start an OAuth sign-in with any email address and use the returned state value to finish a Magic Link sign-in for that address. They never prove that they can read that email.
Impact
An unauthenticated attacker who knows a user's email address can get a normal session for that user, with all of that account's permissions. They need no access to the mailbox, and they do not need to sign in with the OAuth provider or complete an OAuth callback.
If Magic Link sign-up is enabled and no user has the email address, the attacker can instead create an account that Better Auth wrongly marks as email verified, and is signed in to it. The false verified-email flag can also bypass Better Auth's default unproven-account protections when the mailbox owner later signs in, leaving the attacker's session in that account. Applications that trust verified email addresses or email domains may give this account more access, depending on the application.
Patches
The fix is merged for the planned
better-auth1.7.7 release. That package is not available yet.Upgrade
better-authand installed Better Auth adapters, plugins, and integrations released alongside it together. Upgrade servers sharing verification storage in the same cutover. Request new Magic Links and restart pending OAuth or SAML sign-ins; links and state created before the upgrade cannot complete. Update customverification.storeIdentifier.overridesrules to match themagic-link:andauth-state:prefixes. There is no user or account data migration, and public token values and API signatures are unchanged.Workarounds
Until you upgrade to the fixed release, use one of these mitigations:
account.storeStateStrategyto"cookie". If you also use OAuth Proxy, first configure one dedicated OAuth Proxysecretacross all participating environments that differs from each environment's global Better Auth secret. Cookie-backed state can expose a separate OAuth Proxy account-takeover path when the proxy shares the global secret and implicit account linking is enabled.storeTokento"hashed"and leave globalverification.storeIdentifierunset or set it to"plain". Global identifier hashing does not prevent this issue when Magic Link tokens are also hashed.Setting
disableSignUp: trueon the Magic Link plugin is not enough. It only stops the creation of new verified accounts. It does not stop the takeover of existing accounts.Severity
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:NReferences
This data is provided by the GitHub Advisory Database (CC-BY 4.0).
better-auth: OAuth Proxy lets an attacker sign in as another user
GHSA-r4xp-prcw-77qf
More information
Details
Am I affected?
You may be affected if you use
better-authfrom 1.5.0-beta.12 through versions before 1.7.7 with the OAuth Proxy plugin. You are affected only if all of these are also true:secret, or itssecretequals that environment's global Better Auth secret.account.storeStateStrategy: "cookie"). With a database or secondary storage, this is only the case if you chose it explicitly.You are not affected by this path if every participating environment uses a proxy
secretdistinct from its global Better Auth secret, if sign-in state is stored in the database, or if you use a version before 1.5.0-beta.12.Summary
The OAuth Proxy plugin trusts any user profile it can decrypt. In the affected setup, Better Auth encrypts sign-in state, including data the caller chose, with the same secret and hands it to anyone who starts a social sign-in. An attacker can use this to get a fake profile for another user's email address that the proxy accepts as real.
Impact
An attacker without an account who knows a user's verified email address can sign in as that user, with that user's permissions. They can read private data, change the account, and link a provider account of their choice to it. They need no provider sign-in and no action from the victim. No availability impact is established, and a reported open redirect was not confirmed.
Patches
The fix is merged for the planned
better-auth1.7.7 release. That package is not available yet.Upgrade all nodes handling the same cookie-backed OAuth or SAML state flow and all OAuth Proxy participants together, including the production coordinator and preview or development deployments. Keep installed Better Auth packages released alongside
better-authon the same release version. Restart pending sign-in and account-linking flows; pre-upgrade state cookies and proxy payloads are rejected. Public options and API signatures are unchanged.Workarounds
Until you upgrade to the fixed release, apply one of these:
secretacross every environment that takes part in the proxy flow, and keep it different from each environment's global Better Auth secret.account.storeStateStrategy: "database". This is already the default when a database or secondary storage is configured. If Magic Link is also enabled, switching can expose a separate cross-purpose verification-record path in affected releases. Ensure the two flows resolve to distinct stored identifiers; with built-in options, use Magic LinkstoreToken: "hashed"with globalverification.storeIdentifierunset or"plain", or disable Magic Link or both built-in social and Generic OAuth sign-in.Setting
account.accountLinking.disableImplicitLinking: truestops this path from taking over an existing account. It does not fix the underlying flaw: the callback can still accept attacker-made data as a provider identity. Apply one of the steps above as well.Severity
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:NReferences
This data is provided by the GitHub Advisory Database (CC-BY 4.0).
@better-auth/drizzle-adapter: Concurrent requests can exceed rate limits on PostgreSQL
GHSA-44jh-23m7-hpcf
More information
Details
Am I affected?
You are affected if you use
@better-auth/drizzle-adapterfrom 1.6.17 through versions before 1.7.7 (including the 1.7.0 prereleases from beta.6 through rc.6) or@better-auth/kysely-adapter1.6.17 through 1.6.31, and keep rate-limit records in a PostgreSQL database.All of these must be true:
You are not affected if you store rate-limit records in memory (the default) or in secondary storage.
Summary
Database-backed rate limiting on PostgreSQL can let a burst of concurrent requests go over the configured maximum. When many requests arrive at the same time, several of them can pass the limit check together. This weakens the rate limit on password sign-in, two-factor verification, one-time codes, password resets, and other rate-limited endpoints.
Impact
An attacker who sends many requests at once can make more attempts than the application allows.
The issue does not bypass password or one-time-code validation. It does not directly compromise an account. The number of extra attempts is limited by the number of concurrent database connections, the number of application instances, and the rate-limit window.
Patches
@better-auth/kysely-adapteris fixed in 1.7.0. Upgrade to 1.7.0 or later.The Drizzle fix is merged for the planned
@better-auth/drizzle-adapter1.7.7 release. That package is not available yet. Upgradebetter-authand the installed Drizzle adapter together when 1.7.7 is available. No database schema or public API migration is required.Workarounds
In-memory storage also avoids this issue. However, each application instance keeps its own counter, so it may not enforce one shared limit in multi-instance or serverless deployments.
Severity
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:N/A:NReferences
This data is provided by the GitHub Advisory Database (CC-BY 4.0).
Release Notes
better-auth/better-auth (better-auth)
v1.7.7Compare Source
Patch Changes
#11476
4186e36Thanks @bytaesu! - Return CAPTCHA errors with the correct JSON Content-Type header.#11469
8620aa9Thanks @aryan1306! - Return rate limit errors with a JSON Content-Type header.#11491
55cb92eThanks @bytaesu! - Respect social providerdisableSignUpwhen signing in with an ID token.#11375
69defbcThanks @bytaesu! - Refresh the active organization after sign-in when a session hook selects the initial organization.#11494
ac54bfdThanks @gustavovalverde! - Isolate OAuth state cookies and each OAuth Proxy payload with purpose-specific encryption keys. TheoAuthProxyoptions and supported configuration remain unchanged.Upgrade all Better Auth nodes that handle the same cookie-backed OAuth or SAML relay-state flow together. Upgrade every OAuth Proxy participant, including production and preview or development deployments, in the same cutover. OAuth sign-in, account-linking, and cookie-backed SAML sign-in flows started before the upgrade must be restarted. Mixed old and new participants cannot exchange existing state or proxy payloads, and there is no fallback to the previous shared key.
#11494
ac54bfdThanks @gustavovalverde! - Magic Link verification now accepts only records issued for Magic Link. MagicLink records and database-backed OAuth or SAML state use separate verification
identifier prefixes. Links and database-backed sign-ins started before the
upgrade cannot complete; request new Magic Links and restart those sign-ins.
Upgrade servers sharing verification storage together, and update
verification.storeIdentifier.overridesrules for these flows to match the newmagic-link:andauth-state:prefixes. The link token, callback state,endpoints, and public option types are unchanged.
Upgrade installed Better Auth adapters, plugins, and integrations released
with
better-authalongside it so participating packages use the same releaseversion.
Updated dependencies [
35d7cd3,07bdf7e]:v1.7.6Compare Source
Patch Changes
#11325
af88385Thanks @Wadiou! - Admin pluginbannedUserMessagecan now be a function that receives the banned user, so sign-in errors can include details such as the ban reason.#11268
2fa501cThanks @bytaesu! - Support linking social accounts through the OAuth Proxy plugin.#11366
d41e2caThanks @bytaesu! - Use targeted PRAGMA queries when a Kysely dialect cannot introspect Cloudflare D1.#11016
3d0efa3Thanks @davbrito! - Support Vercel BotID checks on protected authentication routes in Vercel-hosted applications.#11333
631ac29Thanks @bytaesu! - Preserve logical model identity when a custom model name matches another schema key.#11324
8853419Thanks @XXMOHAMED012! - Passwords longer thanmaxPasswordLengthare now rejected withPASSWORD_TOO_LONGbefore hashing on sign-in (email, username, phone number), verify-password, change-password (currentPassword), delete-user, the two-factor endpoints that take a password, and admin create-user, matching what sign-up and password reset already did.#11316
2ee1545Thanks @Smidge! - Fix React hydration mismatches when a session or plugin auth query resolves before a streamed component hydrates. Preserve the server-rendered pending state during hydration, then update to the current client state without changing ordinary or computed plugin stores.#11376
fc45d08Thanks @bytaesu! - Prevent older auth-query responses from replacing newer results when requests overlap.Updated dependencies [
41b7dc1,d41e2ca,631ac29,2b13e01]:v1.7.5Compare Source
Patch Changes
#11283
e56c45bThanks @bytaesu! - Log Cloudflare Turnstile error codes and binding mismatches on the server so CAPTCHA verification failures can be diagnosed.#11209
8d37cc3Thanks @siam923! - Remove the unused optionalbetter-sqlite3peer dependency to prevent installation conflicts.#11272
348fc26Thanks @bytaesu! - Use MySQL's reported byte lengths when validating indexes on existing string columns.#11203
cb627ebThanks @dshukertjr! - Add adatabase.schemaNameoption for direct PostgreSQL connections. When set, the adapter and the CLI qualify every statement with that schema, soauth generatewrites a schema-qualified migration that creates the schema before its tables instead of relying on the connection'ssearch_path.#11270
133f6a2Thanks @bytaesu! - Prevent PostgreSQL migrations from treating tables in other schemas or views in the active schema as Better Auth tables.Updated dependencies [
e18bc83,cb627eb,dae97ed]:v1.7.4Compare Source
Patch Changes
#11205
3f890ebThanks @bytaesu! - Support Vitest 5 in the testing utilities while retaining support for previously supported Vitest versions.#11224
c1756a2Thanks @bytaesu! - Addexperimental.instrumentation.enabledto disable Better Auth OpenTelemetry span creation per auth instance. Instrumentation remains enabled by default and independent of usage reporting.#11217
9b9638eThanks @onmax! - AllowtestUtilsauth helpers to accept additional session fields through thesessionoption, including required fields without defaults and per-session overrides of configured defaults.Updated dependencies [
3ff842a,b905bfe,c1756a2]:v1.7.3Compare Source
Patch Changes
#11060
3660f06Thanks @bytaesu! - Handle malformed custom-scheme callback URLs without excessive processing.#11037
5bd7096Thanks @bytaesu! - Prevent repeated TOTP enrollment from replacing an active authenticator and its backup codes.#11120
7ec7146Thanks @onmax! - PreventgetSessionfrom failing when cookie caching is disabled while clients still have cached session cookies.#9908
76d311fThanks @harshil1712! - Add Cloudflare as a built-in social provider, with support for client-secret authentication and PKCE clients without a secret.#11188
c47b765Thanks @bytaesu! - Normalize Auth0 domains without a potentially slow trailing-slash regular expression.#11084
2d5c63dThanks @bytaesu! - Prevent duplicate session requests and hydration mismatches when using the Vue client with NuxtuseFetch.#11147
a9d8c12Thanks @bytaesu! - AddisPasswordCompromisedfor checking passwords against Have I Been Pwned in custom server-side flows, while ignoring padded response entries with zero occurrences.#10988
9fc7498Thanks @bytaesu! - Run callback hooks after proxied OAuth sign-ins and preserve server state when callback cookies are unavailable. The legacy/oauth-proxy-callbackendpoint is deprecated and will be removed in the next minor release.#11178
be0e007Thanks @bytaesu! - Report missing tables, missing columns, and required columns Better Auth never writes during initialization, with guidance for fixing them. Kysely checks the live database schema. Authentication requests await the same check and are rejected if the schema does not match.Validation is enabled by default, including in production. Set
advanced.database.validateSchema: falseto disable runtime validation.auth migraterefuses to apply changes when required unwritten columns need manual repair.#11069
0bb0dbfThanks @bytaesu! - Improve dynamic organization role permission check performance.#11153
2220ee7Thanks @bytaesu! - Restore sign-in compatibility with 1.6 databases by identifying accounts with(providerId, accountId)and removing theissuerrequirement introduced in 1.7.0. Upgrading from 1.6 no longer requires an account schema migration. Ambiguous account keys are rejected instead of selecting an arbitrary account.If you applied the 1.7.0 through 1.7.2 account schema, remove its issuer unique index before upgrading. For SQL databases, also make
issuernullable or remove the column so sign-ups and account linking can succeed.auth migratedoes not perform this cleanup. Follow the upgrade guide for database-specific steps.#10978
5fe5bc2Thanks @BetterAndBetterII! - Skip a generic OAuth provider when discovery fails instead of taking down the rest of the auth API.#10963
74a7369Thanks @thisismert! - Track email OTP sign-ins in the last login method plugin.#11085
e16b40aThanks @bytaesu! - Provide type-safe NuxtuseFetchintegration for the Vue client'suseSessionhook.#11066
c0444dcThanks @bytaesu! - Upgrade the packaged Zod dependency to 4.5. Generated OpenAPI schemas now mark required request fields consistently with runtime validation, including passkey registration responses.Updated dependencies [
352d012,76d311f,3e9e197,157ec8d,baa08f4,9e36635,be0e007,a2bae0c,1a1b7d5,2220ee7]:v1.7.2Compare Source
Patch Changes
#10875
d5d889bThanks @bytaesu! - Fix programmatic migrations failing on Cloudflare D1 while preserving existing-index validation across supported databases.#10982
b4ad5a1Thanks @bytaesu! - Built-in placeholder emails now consistently use the namespaced{identifier}@{namespace}.placeholder.invalidformat.#10934
c7a5c1aThanks @bytaesu! - Cookie-cache reads now warn when signed session data is invalid instead of silently appearing as a signed-out session.#10879
78f0c39Thanks @starslingdev! - Test suites usinggetTestInstancenow run faster because the shared fixture avoids production password-hashing costs by default. CustomemailAndPassword.passwordimplementations continue to take precedence.#10823
ce8a3abThanks @sosyz! - Ensure permanently banning a user clears any expiration from a previous temporary ban.#10907
a021eafThanks @heliohm! - A client created with more plugins is again assignable to a client type declaring fewer plugins, as in 1.6.#10959
c8dcfa5Thanks @bytaesu! - Allow same-origin form submissions from pages usingReferrer-Policy: no-referrerwhile continuing to reject untrusted request origins.#10979
fced1a5Thanks @bytaesu! - Allow relative callback and redirect URLs to use standard path, query, and fragment syntax while preserving open-redirect protections.#10041
f6891a2Thanks @GautamBytes! - Allow~in relative callback URLs validated by trusted origin checks.#10877
649818aThanks @bytaesu! - Prevent disabled MyISAM indexes from satisfying migration index checks.Updated dependencies [
557e19b,64da15b,d5d889b,b4ad5a1,ea77118,5aea9f7,fced1a5,e1d4011]:v1.7.1Patch Changes
#12259
9e2a0ecThanks @gustavovalverde! - Fixed "revoke all sessions" withsecondaryStorageandstoreSessionInDatabaseso that sessions created while the revocation runs are revoked too. Sessions created by asession.delete.afterhook still stay active.#12244
85f4342Thanks @gustavovalverde! -getTestInstancewitConfiguration
📅 Schedule: (UTC)
🚦 Automerge: Enabled.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR was generated by Mend Renovate. View the repository job log.